﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_WORKCENTERS
// * CreateDate    : 2013-02-19 16:53:09
// * Creater       : CodeSmith
// * LastChangeDate: 2013-02-19 16:53:09
// * LastChanger   : 2013-02-19 16:53:09
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class ProdWorkcentersEntity : EntityBase
    {
        public ProdWorkcentersTable TableSchema
        {
            get
            {
                return ProdWorkcentersTable.Current;
            }
        }

        public ProdWorkcentersEntity()
        {

        }

        public ProdWorkcentersEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Code = Convert.ToString(CommonFunctions.ToObject(dr["CODE"]));
            this.Name = Convert.ToString(CommonFunctions.ToObject(dr["NAME"]));
            this.Type = Convert.ToInt32(CommonFunctions.ToObject(dr["TYPE"]));
            this.WorkingPeriod = Convert.ToDecimal(CommonFunctions.ToObject(dr["WORKING_PERIOD"]));
            this.Active = Convert.ToInt32(CommonFunctions.ToObject(dr["ACTIVE"]));
            this.EfficiencyFactor = Convert.ToDecimal(CommonFunctions.ToObject(dr["EFFICIENCY_FACTOR"]));
            this.CapacityCycle = Convert.ToDecimal(CommonFunctions.ToObject(dr["CAPACITY_CYCLE"]));
            this.TimeCycle = Convert.ToDecimal(CommonFunctions.ToObject(dr["TIME_CYCLE"]));
            this.TimeBeforeProd = Convert.ToDecimal(CommonFunctions.ToObject(dr["TIME_BEFORE_PROD"]));
            this.TimeAfterProd = Convert.ToDecimal(CommonFunctions.ToObject(dr["TIME_AFTER_PROD"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.CostHour = Convert.ToDecimal(CommonFunctions.ToObject(dr["COST_HOUR"]));
            this.CostCycle = Convert.ToDecimal(CommonFunctions.ToObject(dr["COST_CYCLE"]));
        }

        public ProdWorkcentersEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Code = Convert.ToString(CommonFunctions.ToObject(dr["CODE"]));
            this.Name = Convert.ToString(CommonFunctions.ToObject(dr["NAME"]));
            this.Type = Convert.ToInt32(CommonFunctions.ToObject(dr["TYPE"]));
            this.WorkingPeriod = Convert.ToDecimal(CommonFunctions.ToObject(dr["WORKING_PERIOD"]));
            this.Active = Convert.ToInt32(CommonFunctions.ToObject(dr["ACTIVE"]));
            this.EfficiencyFactor = Convert.ToDecimal(CommonFunctions.ToObject(dr["EFFICIENCY_FACTOR"]));
            this.CapacityCycle = Convert.ToDecimal(CommonFunctions.ToObject(dr["CAPACITY_CYCLE"]));
            this.TimeCycle = Convert.ToDecimal(CommonFunctions.ToObject(dr["TIME_CYCLE"]));
            this.TimeBeforeProd = Convert.ToDecimal(CommonFunctions.ToObject(dr["TIME_BEFORE_PROD"]));
            this.TimeAfterProd = Convert.ToDecimal(CommonFunctions.ToObject(dr["TIME_AFTER_PROD"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.CostHour = Convert.ToDecimal(CommonFunctions.ToObject(dr["COST_HOUR"]));
            this.CostCycle = Convert.ToDecimal(CommonFunctions.ToObject(dr["COST_CYCLE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdWorkcentersTable.Current;
            }
        }

        #region Perporty List
        public string Code
        {
            get { return Convert.ToString(GetData(ProdWorkcentersTable.C_CODE)); }
            set { SetData(ProdWorkcentersTable.C_CODE, value); }
        }

        public string Name
        {
            get { return Convert.ToString(GetData(ProdWorkcentersTable.C_NAME)); }
            set { SetData(ProdWorkcentersTable.C_NAME, value); }
        }

        public int Type
        {
            get { return Convert.ToInt32(GetData(ProdWorkcentersTable.C_TYPE)); }
            set { SetData(ProdWorkcentersTable.C_TYPE, value); }
        }

        public decimal WorkingPeriod
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_WORKING_PERIOD)); }
            set { SetData(ProdWorkcentersTable.C_WORKING_PERIOD, value); }
        }

        public int Active
        {
            get { return Convert.ToInt32(GetData(ProdWorkcentersTable.C_ACTIVE)); }
            set { SetData(ProdWorkcentersTable.C_ACTIVE, value); }
        }

        public decimal EfficiencyFactor
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_EFFICIENCY_FACTOR)); }
            set { SetData(ProdWorkcentersTable.C_EFFICIENCY_FACTOR, value); }
        }

        public decimal CapacityCycle
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_CAPACITY_CYCLE)); }
            set { SetData(ProdWorkcentersTable.C_CAPACITY_CYCLE, value); }
        }

        public decimal TimeCycle
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_TIME_CYCLE)); }
            set { SetData(ProdWorkcentersTable.C_TIME_CYCLE, value); }
        }

        public decimal TimeBeforeProd
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_TIME_BEFORE_PROD)); }
            set { SetData(ProdWorkcentersTable.C_TIME_BEFORE_PROD, value); }
        }

        public decimal TimeAfterProd
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_TIME_AFTER_PROD)); }
            set { SetData(ProdWorkcentersTable.C_TIME_AFTER_PROD, value); }
        }

        public string ProductId
        {
            get { return Convert.ToString(GetData(ProdWorkcentersTable.C_PRODUCT_ID)); }
            set { SetData(ProdWorkcentersTable.C_PRODUCT_ID, value); }
        }

        public decimal CostHour
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_COST_HOUR)); }
            set { SetData(ProdWorkcentersTable.C_COST_HOUR, value); }
        }

        public decimal CostCycle
        {
            get { return Convert.ToDecimal(GetData(ProdWorkcentersTable.C_COST_CYCLE)); }
            set { SetData(ProdWorkcentersTable.C_COST_CYCLE, value); }
        }

        #endregion
    }


}

